Skip to content

Conversation

ValentinBossi
Copy link

@ValentinBossi ValentinBossi commented Aug 26, 2025

resolves #879

@@ -76,7 +76,9 @@ export async function translateFederationArtefacts(

const sourceLocalePath = path.join(outputPath, 'browser', sourceLocale);

const cmd = `node node_modules/.bin/localize-translate -r ${sourceLocalePath} -s "${sourcePattern}" -t ${translationFiles} -o ${translationOutPath} --target-locales ${targetLocales} -l ${sourceLocale}`;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here executing execSync("node node_modules/.bin/localize-translate ... ") where "localize-translate" contains

@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0

IF EXIST "%dp0%\node.exe" (
  SET "_prog=%dp0%\node.exe"
) ELSE (
  SET "_prog=node"
  SET PATHEXT=%PATHEXT:;.JS;=;%
)

endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\@angular\localize\tools\bundles\src\translate\cli.js" %*

does not make much sense, no? we execute it a bit node wrapped, something like node node translate -args i guess.

const cmd = `node node_modules/.bin/localize-translate -r ${sourceLocalePath} -s "${sourcePattern}" -t ${translationFiles} -o ${translationOutPath} --target-locales ${targetLocales} -l ${sourceLocale}`;
const localizeTranslate = path.resolve("node_modules/.bin/localize-translate");

const cmd = `${localizeTranslate} -r ${sourceLocalePath} -s "${sourcePattern}" -t ${translationFiles} -o ${translationOutPath} --target-locales ${targetLocales} -l ${sourceLocale}`;
Copy link
Author

@ValentinBossi ValentinBossi Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also just removing "node" in the cmd makes some trouble so i use path.resolve().
this code is tested and runs on windows 11 and on gitpod with a linux.

@ValentinBossi ValentinBossi changed the title resolve path to translate script and execute the script directly resolve path to localize-translate script and execute the script directly Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build with localize throws error under Windows
1 participant